#include "eeprom_drv.h"
void EEPROM_Wirte_Byte(uint8_t addr,uint8_t byte)
{
	IIC_Start();
	IIC_Send_Byte(0XA0);
	IIC_Wait_Ack();
	IIC_Send_Byte(addr);
  IIC_Wait_Ack();
	IIC_Send_Byte(byte);
  IIC_Wait_Ack();
	IIC_Stop();

}


void EEPROM_Read_Byte(uint8_t addr,uint8_t *byte)
{
	IIC_Start();
	IIC_Send_Byte(0XA0);
	IIC_Wait_Ack();
	IIC_Send_Byte(addr);
  IIC_Wait_Ack();
	IIC_Start();
	IIC_Send_Byte(0XA1);
  IIC_Wait_Ack();
	SDA_H;
	 *byte=IIC_Recv_Byte();
	SCL_H;
	HAL_Delay(1);
	IIC_SEND_NACK;
	IIC_Stop();
}
void EEPROM_Wirte_Byte1(uint8_t addr,uint8_t byte)
{
	IIC_Start();
	IIC_Send_Byte(0XA2);
	IIC_Wait_Ack();
	IIC_Send_Byte(0);
  IIC_Wait_Ack();
	IIC_Send_Byte(addr);
  IIC_Wait_Ack();
	IIC_Send_Byte(byte);
  IIC_Wait_Ack();
	IIC_Stop();

}


void EEPROM_Read_Byte1(uint8_t addr,uint8_t *byte)
{
	IIC_Start();
	IIC_Send_Byte(0XA2);
	IIC_Wait_Ack();
	IIC_Send_Byte(0);
  IIC_Wait_Ack();
	IIC_Send_Byte(addr);
  IIC_Wait_Ack();
	IIC_Start();
	IIC_Send_Byte(0XA3);
  IIC_Wait_Ack();
	SDA_H;
	 *byte=IIC_Recv_Byte();
	SCL_H;
	HAL_Delay(1);
	IIC_SEND_NACK;
	IIC_Stop();

}



